package com.example.demo.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

/**
 * @author: Bin.L
 * @date: 2021/4/9 09:36
 * @Description:
 */
@Service
@Slf4j
public class SmsListener implements ApplicationListener<MessageEvent> {

    @Override
    public void onApplicationEvent(MessageEvent messageEvent) {
        log.info(" {} send SMS start. . .  ", Thread.currentThread().getName());
        log.warn(" SMS send process, send message: {}", messageEvent.getMessage());
        log.info(" SMS send complete. . . ");
    }
}
